$(function() {
  //提交订单
  $("#submit_order").click(function(){ 
	  var request = GetRequest();
	  var id = request['id'];
	  var q_id = request['q_id'];
	  if(q_id == '' || q_id < 0){alert("数据信息错误");return false;}
      var json_data = {id:id,q_id:q_id};
      ajax_post("/wap/user/user_order",json_data,function(data) {
      if(data.status) {
          window.location.href = data.refer;  
      }
    });
  });
});

//获取url参数
function GetRequest() {   
   var url = location.search; //获取url中"?"符后的字串   
   var theRequest = new Object();   
   if (url.indexOf("?") != -1) {   
      var str = url.substr(1);   
      strs = str.split("&");   
      for(var i = 0; i < strs.length; i ++) {   
         theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);   
      }   
   }   
   return theRequest;   
}   

  